#!/bin/bash

for i in `seq 1 1 40`
do
  awk '$10==0.000 {print $1,"u"}' k$i.dat > uu$i.dat
  awk '$10>0.7 && $3>0.5 {print $1,"b"}' k$i.dat > bb$i.dat
  cat uu$i.dat bb$i.dat|sort -n -k 1 > ubub$i.dat
  /home/rhome/wangyong/zhaolingci_io4/Go-DCL1-A/ana/kinetic/countTransition.x ubub$i.dat >> counts.dat
  rm uu$i.dat bb$i.dat ubub$i.dat
done
 cat counts.dat | awk '{sum+=$1}END{print sum}'
 rm counts.dat
